package com.example.houqin_oa.controller;

import com.example.comment_oa.pojos.RepairRecord;
import com.example.comment_oa.response.AjaxResponse;
import com.example.houqin_oa.service.RepairRecordService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description:维修
 * @Author:陈旭良
 * @Documents_And_Settings:liang
 * @Date:2022/10/12 19:04
 * @Entry_Name:my_springcloud_project01cangku
 */
@RestController
@CrossOrigin
@RequestMapping("/houqinOa")
public class RepairController {

    @Autowired
    RepairRecordService repairRecordService;

    @PostMapping("/Repair/Query")
    public AjaxResponse RepairApply(@RequestBody RepairRecord repairRecord){
        return AjaxResponse.success(repairRecordService.RepairApply(repairRecord));
    }

    @PutMapping("/Repair/Operation")
    public AjaxResponse Operation(@RequestBody RepairRecord repairRecord){
        return AjaxResponse.success(repairRecordService.Operation(repairRecord));
    }

    @PostMapping("/Repair/KeepAsk")
    public AjaxResponse KeepAsk(@RequestBody RepairRecord repairRecord){
        return AjaxResponse.success(repairRecordService.KeepAsk(repairRecord));
    }
    //个人物品维修新增
    @PostMapping("/Repair/NewMaintenance")
    public AjaxResponse NewMaintenance(@RequestBody RepairRecord repairRecord){
        return AjaxResponse.success(repairRecordService.NewMaintenance(repairRecord));
    }

    //公共物品维修新增
    @PostMapping("/Repair/AddRear")
    public AjaxResponse AddRear(@RequestBody RepairRecord repairRecord){
        return AjaxResponse.success(repairRecordService.AddRear(repairRecord));
    }

}
